#if UNITY_EDITOR
using System.Reflection;
using System.Collections.Generic;
#endif

/// <summary>
/// <para>教学节点编辑器使用的特殊成员处理方式的接口</para>
/// </summary>
public abstract class IEditorSpecialMember
{
#if UNITY_EDITOR
    public static HashSet<string> EmptyParms = new HashSet<string>();
    /// <summary>
    /// <para>设置教学节点使用的特殊成员的相关的编辑器变量</para>
    /// </summary>
    public abstract void SetEditorValue(ref object inst, MemberInfo member, object memberVal);
    /// <summary>
    /// <para>在编辑器中显示该特殊类型变量的函数</para>
    /// </summary>
    public abstract void DisplayInEditor(object inst, float standardWidth, string label, object jeaVal, MemberInfo member, MemberInfo jeaMember, int index = 0);

    public HashSet<string> GetEditorParms(MemberInfo jeaMember)
    {
        var attList = jeaMember.GetCustomAttributes(typeof(JsonEditorparametersAttribute), false);
        if(attList.Length > 0)
        {
            return ((JsonEditorparametersAttribute)attList[0]).parmsSet;
        }
        return EmptyParms;
    }
	#endif
}